home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20031118-20041115
/
000398_fdc@columbia.edu_Tue Sep 21 17:51:07 2004.msg
< prev
next >
Wrap
Internet Message Format
|
2004-11-14
|
2KB
Path: newsmaster.cc.columbia.edu!not-for-mail
From: Frank da Cruz <fdc@columbia.edu>
Newsgroups: comp.protocols.kermit.misc
Subject: Re: Return codes and If statments
Date: 21 Sep 2004 21:51:01 GMT
Organization: Columbia University
Lines: 50
Message-ID: <slrncl18i5.56s.fdc@sesame.cc.columbia.edu>
References: <3f9c05b0.0409211252.5aa51cb1@posting.google.com>
Reply-To: fdc@columbia.edu
NNTP-Posting-Host: sesame.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 1095803461 4227 128.59.59.56 (21 Sep 2004 21:51:01 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 21 Sep 2004 21:51:01 GMT
User-Agent: slrn/0.9.8.0 (SunOS)
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:15175
On 2004-09-21, Peter V. <dm_v_2000@yahoo.com> wrote:
: I am modifying a C-Kermit script I have to not continue processing
: if a call to another script does not return a value of 1 (We are doing
: this for fail over testing).
:
: Here is the C-Kermit code in question:
:
: # run the db_status script in the CRON directory
: run db_status
:
: # See if the ret value is != 1
: # If it != 1 tell user we are not on the primay server and then
: exit).
:
: if != \v(pexitstat) 1
: {
: echo Return code != 1 ... Not the primary server
: echo return code = \v(pexitstat)
: exit
:
: }
: # otherwise we are on the primary server so continue processing
: ...
: ...
: ...
:
: When I run this on the Secondary server it works (since the result
: returned from the db_status script is a 2 since it is not the primary
: server).
:
: However, when I test this on the primay server the code exits (meaning
: it executes the body of the if statment above) despite the fact that
: the return code from db_status is 1.
:
: Any suggestions, as to what I'm doing wrong?
:
My first suggestion is to use the recommended format for grouping statements:
if != \v(pexitstat) 1 {
echo Return code != 1 ... Not the primary server
echo return code = \v(pexitstat)
exit
}
If that doesn't help, then check to see what the subprocess actually
returns as its exit code (OK, you say it is 1 but...). If so, then make sure
you are running the current version of C-Kermit, which is 8.0.211. If you
are, then we're in for some debugging; contact kermit-support@columbia.edu.
- Frank